#include <hxcpp.h>

#ifndef INCLUDED_format_tools_IO
#include <format/tools/IO.h>
#endif
#ifndef INCLUDED_haxe_io_Bytes
#include <haxe/io/Bytes.h>
#endif
#ifndef INCLUDED_haxe_io_Input
#include <haxe/io/Input.h>
#endif
#ifndef INCLUDED_haxe_io_Output
#include <haxe/io/Output.h>
#endif
namespace format{
namespace tools{

Void IO_obj::__construct()
{
	return null();
}

IO_obj::~IO_obj() { }

Dynamic IO_obj::__CreateEmpty() { return  new IO_obj; }
hx::ObjectPtr< IO_obj > IO_obj::__new()
{  hx::ObjectPtr< IO_obj > result = new IO_obj();
	result->__construct();
	return result;}

Dynamic IO_obj::__Create(hx::DynamicArray inArgs)
{  hx::ObjectPtr< IO_obj > result = new IO_obj();
	result->__construct();
	return result;}

Void IO_obj::copy( ::haxe::io::Input i,::haxe::io::Output o,::haxe::io::Bytes buf,int size){
{
		HX_SOURCE_PUSH("IO_obj::copy")
		HX_SOURCE_POS("/usr/lib/haxe/lib/format/1,22/format/tools/IO.hx",32)
		int bufsize = buf->length;
		HX_SOURCE_POS("/usr/lib/haxe/lib/format/1,22/format/tools/IO.hx",33)
		while(((size > (int)0))){
			HX_SOURCE_POS("/usr/lib/haxe/lib/format/1,22/format/tools/IO.hx",34)
			int n = i->readBytes(buf,(int)0,(  (((size > bufsize))) ? int(bufsize) : int(size) ));
			HX_SOURCE_POS("/usr/lib/haxe/lib/format/1,22/format/tools/IO.hx",35)
			hx::SubEq(size,n);
			HX_SOURCE_POS("/usr/lib/haxe/lib/format/1,22/format/tools/IO.hx",36)
			o->writeFullBytes(buf,(int)0,n);
		}
	}
return null();
}


STATIC_HX_DEFINE_DYNAMIC_FUNC4(IO_obj,copy,(void))


IO_obj::IO_obj()
{
}

void IO_obj::__Mark(HX_MARK_PARAMS)
{
	HX_MARK_BEGIN_CLASS(IO);
	HX_MARK_END_CLASS();
}

void IO_obj::__Visit(HX_VISIT_PARAMS)
{
}

Dynamic IO_obj::__Field(const ::String &inName,bool inCallProp)
{
	switch(inName.length) {
	case 4:
		if (HX_FIELD_EQ(inName,"copy") ) { return copy_dyn(); }
	}
	return super::__Field(inName,inCallProp);
}

Dynamic IO_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
	return super::__SetField(inName,inValue,inCallProp);
}

void IO_obj::__GetFields(Array< ::String> &outFields)
{
	super::__GetFields(outFields);
};

static ::String sStaticFields[] = {
	HX_CSTRING("copy"),
	String(null()) };

static ::String sMemberFields[] = {
	String(null()) };

static void sMarkStatics(HX_MARK_PARAMS) {
};

static void sVisitStatics(HX_VISIT_PARAMS) {
	HX_VISIT_MEMBER_NAME(IO_obj::__mClass,"__mClass");
};

Class IO_obj::__mClass;

void IO_obj::__register()
{
	Static(__mClass) = hx::RegisterClass(HX_CSTRING("format.tools.IO"), hx::TCanCast< IO_obj> ,sStaticFields,sMemberFields,
	&__CreateEmpty, &__Create,
	&super::__SGetClass(), 0, sMarkStatics, sVisitStatics);
}

void IO_obj::__boot()
{
}

} // end namespace format
} // end namespace tools
